/*
 Created by Tangruiwen on 15/12/19.

 a realy simple JNI realization
 just contain the heap stack and we do not have the native function table;
 just use the java native function name to pick the right function
 */

#ifndef CUSTOMJVM_NATIVEMETHODS_H
#define CUSTOMJVM_NATIVEMETHODS_H

#include "types.h"

class ClassHeap;
class ObjectHeap;

class JNIEnv{
public:
    Frame* pFrameStack;
    ClassHeap* pClassHeap;
    ObjectHeap* pObjectHeap;

    JNIEnv():pFrameStack(NULL),pClassHeap(NULL),pObjectHeap(NULL){}
};

Variable Add(JNIEnv* env);
Variable Print(JNIEnv* env);

Variable String_valueOf_F(JNIEnv* env);
Variable String_valueOf_J(JNIEnv* env);

Variable StringBuilder_toString_String(JNIEnv* env);
/*
function pionter used by ExecutionEngine
*/
typedef Variable (*pNativeMethod)(JNIEnv* env);

#endif //CUSTOMJVM_NATIVEMETHODS_H
